package com.qf.deployee.controll;

import com.qf.deployee.pojo.User;
import com.qf.deployee.service.IUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @Auther: xiaobobo
 * @Date: 2019/5/29 11:10
 * @Description:
 */
/*@RestController */
    @Controller
public class UserControll {

    /**
     * 获取数据用的
     */
    @Autowired
    private IUserService userService=null;

    /**
     * 请求数据
     * @return
     */
    @GetMapping("list")
    @ResponseBody
    public List<User> list(){

        List<User> users=userService.list();

        System.out.println("返回来的数据是:"+users);

        return users;
    }

}
